﻿using OpenCvSharp.ImgHash;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TemplateMatch
{
    public class Template
    {
        public string Name;
        public TemplateStatus Status;
        private int index;

        Image TemplateImage;

        public Template(int Index)
        {
            this.Status = TemplateStatus.NotSaved;
            this.index = Index;
        }

        public int GetIndex()
        {
            return this.index;
        }

        public void SetImage(Image img)
        {
            this.TemplateImage = img;
        }

        public void Save(string folderName)
        {
            string filename = folderName + "\\" + this.Name + ".png";
            this.TemplateImage.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
        }

        public void Dispose()
        {
            this.TemplateImage.Dispose();
        }

        public Image GetImage()
        {
            return this.TemplateImage;
        }
    }

    public enum TemplateStatus
    {
        NotSaved,
        Saved,
        Skipped,
    }
}
